package com.fz.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by webrx on 2017/6/30.
 */
@Controller  @RequestMapping("/admin")
public class Good {
    @RequestMapping("/show.good") @ResponseBody
    public  String show(){
        return "显示";
    }

    @RequestMapping("/add.good") @ResponseBody
    public  String add(){
        return "添加";
    }

    @RequestMapping("/login.good")
    public  String login(){
        return "redirect:user.jsp";

    }
    /*@ResponseBody要是把这句话加上是不能跳转到别的页面直接输出*/
    @RequestMapping("/logout")
    public String loginout(HttpServletRequest req){
        req.getSession().removeAttribute("admin");
       // req.getSession().invalidate();
        return "redirect:/";
    }
    @RequestMapping("/edit.good") @ResponseBody
    public  String edit(){
       return "文件";
    }



}
